<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/23
 * Time: 18:03
 */

namespace zhtfrontend\modules\cus\components\services;


use yii\db\Migration;
use yii\db\ColumnSchemaBuilder;

class Dso extends Migration
{
    public function addColumn($table, $column, $type)
    {
        $this->db->createCommand()->addColumn($table, $column, $type)->execute();
        if ($type instanceof ColumnSchemaBuilder && $type->comment !== null) {
            $this->db->createCommand()->addCommentOnColumn($table, $column, $type->comment)->execute();
        }
    }
}